import java.math.*;

import static java.lang.Math.pow;

class 水仙花数 {
    public static void main(String[] args) {
        for(int i=100;i<=999;i++){
            int ge = i%10;
            int shi =i/10%10;
            int bai =i/100;
            int num;
            num = (int) (pow(ge,3)+ pow(shi,3)+ pow(bai,3));
            if(num==i){
                System.out.println(i);
            }

        }
    }
}

